//
//  DynamicViewController.m
//  Camera
//
//  Created by gml on 2019/1/18.
//  Copyright © 2019年 gml. All rights reserved.
//

#import "DynamicViewController.h"
#import "GravityViewController.h"

@interface DynamicViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;

@end

@implementation DynamicViewController

- (void)viewDidLoad {
    [super viewDidLoad];

}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    
    return 7;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    
    if (cell == nil)
    {
        
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }
    
    
    switch ([indexPath row])
    {
        case 0:
            cell.textLabel.text = @"Gravity";
            break;
        case 1:
            cell.textLabel.text = @"Collisions";
            break;
        case 2:
            cell.textLabel.text = @"Attachments";
            break;
        case 3:
            cell.textLabel.text = @"Springs";
            break;
        case 4:
            cell.textLabel.text = @"Snap";
            break;
        case 5:
            cell.textLabel.text = @"Forces";
            break;
        case 6:
            cell.textLabel.text = @"Properties";
            break;
        default:
            break;
    }
    
    
    return cell;
    
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    UIViewController *viewController = nil;
    
    switch ([indexPath row])
    {
        case 0:
            viewController = [[GravityViewController alloc] init];
            break;
        case 1:
            viewController = [[UIViewController alloc] init];
            break;
        case 2:
            viewController = [[UIViewController alloc] init];
            break;
        case 3:
            viewController = [[UIViewController alloc] init];
            break;
        case 4:
            viewController = [[UIViewController alloc] init];
            break;
        case 5:
            viewController = [[UIViewController alloc] init];
            break;
        case 6:
            viewController = [[UIViewController alloc] init];
        default:
            break;
    }
    
    [self.navigationController pushViewController:viewController animated:YES];
    
}

@end
